import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/views/home/Home.vue'

Vue.use(Router)

export default new Router({
	routes: [{
			path: '/',
			name: 'home',
			component: Home,
			meta: {
				title: "首页",
				TabbarShow: true,
			}
		},
		{
			path: '/product',
			name: 'product',
			component: () => import( /* webpackChunkName: "product" */ '@/views/product/Product.vue'),
			meta: {
				title: "游戏列表",
				TabbarShow: true,
			}
		},
		{
			path: '/product/detail/:id',
			name: 'productDetail',
			component: () => import( /* webpackChunkName: "product" */ '@/views/product/ProductDetail.vue'),
			meta: {
				title: "游戏详情",
				TabbarShow: false,
			}
		},
		{
			path: '/product/review/:id',
			name: 'productReview',
			component: () => import( /* webpackChunkName: "product" */ '@/views/product/ProductReview.vue'),
			meta: {
				title: "游戏评价"
			}
		},
		{
			path: '/product/review/detail/:id',
			name: 'productReviewDetail',
			component: () => import( /* webpackChunkName: "product" */ '@/views/product/ProductReviewDetail.vue'),
			meta: {
				title: "评价"
			}
		},
		{
			path: '/shopcart',
			name: 'shopcart',

			component: () => import( /* webpackChunkName: "product" */ '@/views/shopcart/Shopcart.vue'),
			meta: {
				title: "购物车",
				TabbarShow: false,
			}
		},
		{
			path: '/user',
			name: 'user',

			component: () => import( /* webpackChunkName: "product" */ '@/views/user/User.vue'),
			meta: {
				title: "我的",
				TabbarShow: true,
			}
		},
		{
			path: '/collection',
			name: 'collection',
			component: () => import( /* webpackChunkName: "product" */ '@/views/collection/collection.vue'),
			meta: {
				title: "我的收藏",
				TabbarShow: false,
			}
		},
		{
			path: "/login",
			component: () => import("@/views/user/Login.vue"),
			name: "login",
			meta: {
				title: "登录",
				TabbarShow: false,
			}
		},
		{
			path: "/register",
			component: () => import("@/views/user/Register.vue"),
			name: "register",
			meta: {
				title: "用户注册"
			}
		},
		{
			path: "/ruser/profile",
			component: () => import("@/views/user/Profile.vue"),
			name: "profile",
			meta: {
				title: "个人资料"
			}
		},
		{
			path: "/user/updatePwd",
			component: () => import("@/views/user/UpdatePwd.vue"),
			name: "updatePwd",
			meta: {
				title: "修改密码"
			}
		},
		{
			path: "/order/create/:id",
			component: () => import("@/views/order/OrderCreate.vue"),
			name: "orderCreate",
			meta: {
				title: "新建订单",
			},
		},
		{
			path: "/order/list",
			component: () => import("@/views/order/OrderList.vue"),
			name: "orderList",
			meta: {
				title: "我的订单",
				requireAuth: true
			},
		},
		{
			path: "/order/detail/:id",
			component: () => import("@/views/order/OrderDetail.vue"),
			props: true,
			name: "orderDetail",
			meta: {
				title: "订单详情",
				requireAuth: true
			},
		},
		{
			path: "/user/mygames",
			component: () => import("@/views/user/mygames.vue"),
			props: true,
			name: "mygames",
			meta: {
				title: "我的游戏",
				requireAuth: true
			},
		},
		{
			path: "/forum/forum",
			component: () => import("@/views/forum/forum.vue"),
			props: true,
			name: "forum",
			meta: {
				title: "论坛",
				requireAuth: true,
				TabbarShow: true,
			},
		},
		{
			path: '/forum/detail/:id',
			name: 'forumDetail',
			component: () => import( /* webpackChunkName: "product" */ '@/views/forum/ForumDetail.vue'),
			meta: {
				title: "游戏论坛详情"
			}
		},
		{
			path: '/forum/myforum',
			name: 'myForum',
			component: () => import( /* webpackChunkName: "product" */ '@/views/forum/myForum.vue'),
			meta: {
				title: "我的关注"
			}
		},
		{
			path: '/forum/review/:id',
			name: 'forumReview',
			component: () => import( /* webpackChunkName: "product" */ '@/views/forum/ForumReview.vue'),
			meta: {
				title: "论坛评价"
			}
		},
		{
			path: '/forum/updatereview/:id',
			name: 'updateForumReview',
			component: () => import( /* webpackChunkName: "product" */
				'@/views/forum/ForumUpdateReview.vue'),
			meta: {
				title: "修改评价"
			}
		},
		{
			path: '/forum/review/detail/:id',
			name: 'forumReviewDetail',
			component: () => import( /* webpackChunkName: "product" */ '@/views/forum/ForumReviewDetail.vue'),
			meta: {
				title: "评价"
			}
		},
		{
			path: "/appointment/appointment",
			component: () => import("@/views/appointment/appointment.vue"),
			name: "appointment",
			meta: {
				title: "预约",
				requireAuth: true
			},
		},
		{
			path: "/appointment/appointmentDetail/:id",
			component: () => import("@/views/appointment/appointmentDetail.vue"),
			name: "appointmentDetail",
			meta: {
				title: "预约详情",
				requireAuth: true
			},
		},
		{
			path: "/appointment/myappointment",
			component: () => import("@/views/appointment/myAppointment.vue"),
			name: "myAppointment",
			meta: {
				title: "我的预约",
				requireAuth: true
			},
		},
		{
			path: "/ranking/rankinglist",
			component: () => import("@/views/ranking/rankingList.vue"),
			name: "ranking",
			meta: {
				title: "排行榜",
				requireAuth: true
			},
		},
		{
			path: "/set/set",
			component: () => import("@/views/set/set.vue"),
			name: "set",
			meta: {
				title: "设置",
				requireAuth: true
			},
		},
		{
			path: "/about/about",
			component: () => import("@/views/about/about.vue"),
			name: "about",
			meta: {
				title: "关于我们",
				requireAuth: true
			},
		},
		{
			path: "/search/search",
			component: () => import("@/views/search/search.vue"),
			name: "search",
			meta: {
				title: "搜索",
				requireAuth: true
			},
		},
	]
})
